package org.hsc.service;

import java.util.Date;
import java.util.List;

import org.hsc.dao.ArticleDAO;
import org.hsc.model.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ArticleService {
	@Autowired ArticleDAO dao;
	
	public void add(Article art) {
		dao.add(art);
	}
	
	
	public Article get(Long id) {
		return dao.get(id);
	}


	public void update(Article art) {
		art.setUpdateTime(new Date());
		dao.update(art);
	}


	public List<Article> getSub(Long id) {
		return dao.getSub(id);
	}
	
	public List<Article> getNvg() {
		return dao.getNvg();
	}


	public void delete(Long id) {
		 dao.delete(id);
	}
}
